<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Title</title>
</head>
<body>
<p th:text="${msg}"></p>
[[${msg}]]
<hr>
<p class="clock"></p>
<hr>
<button >fetch get</button>
<button>fetch post</button>
<button>fetch put</button>

<script>

    function clock() {
        fetch("/clock", {method:"get"})
            .then(res => res.text())
            .then(res => {document.querySelector(".clock").innerHTML = res})
            .catch(err => {console.log(err)})
    }
    clock()
    setInterval(clock,1000)

</script>



</body>
</html>
